Page({
  data: {
    title: '',
    prize: ''
  },

  onTitleInput: function(e) {
    this.setData({ title: e.detail.value });
  },

  onPrizeInput: function(e) {
    this.setData({ prize: e.detail.value });
  },

  submitLottery: function() {
    const { title, prize } = this.data;
    if (!title || !prize) {
      wx.showToast({
        title: '请填写完整信息',
        icon: 'none'
      });
      return;
    }

    // 这里可以调用后端接口保存抽奖活动
    wx.showToast({
      title: '抽奖活动已创建',
      icon: 'success'
    });
    wx.navigateBack();
  }
});